package com.wodsy.phoenix.dataobject.shoppingcart.model;

// Generated 2015-5-15 14:59:21 by Hibernate Tools 3.4.0.CR1

import static javax.persistence.GenerationType.IDENTITY;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import com.wodsy.phoenix.dataobject.base.PhoenixObject;

/**
 * TbSkuProperty generated by hbm2java
 */
@Entity
@Table(name = "tb_sku_property", catalog = "shoppingcartc")
public class SkuProperty extends PhoenixObject {

	private Integer id;
	//private int cartItemId;
	private int propertyId;
	private String propertyValue;
	
	private ShoppingcartItem shoppingcartItem;
	
	@ManyToOne(cascade=CascadeType.ALL)
	@JoinColumn(name="cartItemId")
	public ShoppingcartItem getShoppingcartItem() {
		return shoppingcartItem;
	}

	public void setShoppingcartItem(ShoppingcartItem shoppingcartItem) {
		this.shoppingcartItem = shoppingcartItem;
	}

	public SkuProperty() {
	}

	public SkuProperty(int propertyId, String propertyValue) {
		this.propertyId = propertyId;
		this.propertyValue = propertyValue;
	}

	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "id", unique = true, nullable = false)
	public Integer getId() {
		return this.id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	@Column(name = "property_id", nullable = false)
	public int getPropertyId() {
		return this.propertyId;
	}

	public void setPropertyId(int propertyId) {
		this.propertyId = propertyId;
	}

	@Column(name = "property_value", nullable = false, length = 30)
	public String getPropertyValue() {
		return this.propertyValue;
	}

	public void setPropertyValue(String propertyValue) {
		this.propertyValue = propertyValue;
	}

	@Override
	public String toString() {
		return "SkuProperty [id=" + id + ", propertyId=" + propertyId
				+ ", propertyValue=" + propertyValue + "]";
	}

}
